package com.myspace.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

public class MSBaseActivity extends Activity {

	protected LinearLayout mMainView;
	private TextView mPageName;
	public LayoutInflater mInflater;
	
	public MSBaseActivity() {
		super();
	}

	protected void setPageName(int PageName) {
		mPageName.setText(PageName);
	}
	
	protected void setPageName(String pageName) {
		mPageName.setText(pageName);
	}
	
	protected void setMainView(int viewId) {
		mInflater = LayoutInflater.from(this);
		View view = mInflater.inflate(viewId, null);
		mMainView.addView(view);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.msbase);
		mMainView = (LinearLayout) findViewById(R.id.MainView);
		mPageName = (TextView) findViewById(R.id.Header_Page);
	}
	
	protected void showToast(String string) {
		Toast.makeText(this, string, Toast.LENGTH_LONG).show();
	}
	
	protected void gotoPage(Class<?> gotoClass) {
		Intent intent = new Intent(this, gotoClass);
		this.startActivity(intent);
	}
}